<template>
    <view v-if="file">
        <file-cell :file="file" ref="fileCellRef"></file-cell>
    </view>
</template>
<script setup>
import FileCell from "@/module/disk/components/FileCell/index";
import request from '@/utils/request';
import useApp from '@/hooks'
const { $ } = useApp();
import { watch } from "vue";
const file = ref(null)
const props = defineProps({
    fileId: {
        type: [String, Number]
    }
})
function queryFile() {
    request({
        url: '/ufs/file/' + props.fileId,
        method: 'get'
    }).then(res => {
        file.value = res;
    })
}
watch(() => props.fileId, () => {
    if (!$.isEmpty(props.fileId)) {
        queryFile
    }
})

queryFile();
</script>